package  
{
	import mx.core.SpriteAsset;
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.graphics.Spritemap;
	import net.flashpunk.FP;
	
	/**
	 * ...
	 * @author Donatello
	 */
	
	public class Fire extends Entity
	{
		[Embed(source = "img/firesheet.png" )] private const FIRE_ANIM:Class;
		
		private var fireAnim:Spritemap;
		
		public function Fire(px:Number =200, py:Number = 0) 
		{
			
			fireAnim = new Spritemap(FIRE_ANIM,14,26);
			fireAnim.add("fireing", [0,1,2,3,4,5,6,7], 10, true);
			
			graphic = fireAnim;
			
			fireAnim.play("fireing");
			
			setHitbox(14, 26);
			x = px;
			y = py;
			type = "Fire";
		}
		
		
		override public function update():void
		{
			y += 10;
			
			if (y > FP.screen.height)
				FP.world.remove(this);
				
				
			if (collide("Wall", this.x, this.y))
			{
				FP.world.remove(this);			
			}
			
		}
		
	}

}